package de.herberlin.webapp.text;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
/**
 * Entity class Page
 * Page.java
 * 
 * Created on 16. Oktober 2007, 23:02
 * 
 * @author herberlin
 */
@Entity
public class Page implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
    private String id;
    
    @Lob @Column(columnDefinition="longtext")
    private String text=null;
    
    private String headline=null;
    private int verticalMenu=0;
    private int horizontalMenu=0;
    private String template=null;
        
    /** Creates a new instance of Page */
    public Page() {
    }

    /**
     * Gets the id of this Page.
     * @return the id
     */
    public String getId() {
        return this.id;
    }

    /**
     * Sets the id of this Page to the specified value.
     * @param id the new id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * Returns a hash code value for the object.  This implementation computes 
     * a hash code value based on the id fields in this object.
     * @return a hash code value for this object.
     */
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    /**
     * Determines whether another object is equal to this Page.  The result is 
     * <code>true</code> if and only if the argument is not null and is a Page object that 
     * has the same id field values as this object.
     * @param object the reference object with which to compare
     * @return <code>true</code> if this object is the same as the argument;
     * <code>false</code> otherwise.
     */
    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Page)) {
            return false;
        }
        Page other = (Page)object;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
        return true;
    }

    /**
     * Returns a string representation of the object.  This implementation constructs 
     * that representation based on the id fields.
     * @return a string representation of the object.
     */
    @Override
    public String toString() {
        return "de.herberlin.fotoherbertz.Page[id=" + id + "]";
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getHeadline() {
        return headline;
    }

    public void setHeadline(String headline) {
        this.headline = headline;
    }

    public int getVerticalMenu() {
        return verticalMenu;
    }

    public void setVerticalMenu(int verticalMenu) {
        this.verticalMenu = verticalMenu;
    }

    public int getHorizontalMenu() {
        return horizontalMenu;
    }

    public void setHorizontalMenu(int horizontalMenu) {
        this.horizontalMenu = horizontalMenu;
    }

    public String getTemplate() {
        return template;
    }

    public void setTemplate(String template) {
        this.template = template;
    }
    
}
